<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<include file="Public:base" />
<script type="text/javascript">
$(document).ready(function() {


	$("#artcateform").validate({
		
		errorPlacement: function (error, element) {
            error.appendTo(element.parent().find('label'));
            element.parent().addClass("has-error");
        },
        //获取焦点时不验证 
        focusInvalid: false,   
        onkeyup: false ,
		rules : {
			'name' : {
				required : true,
			},
			'orderby' : {
				required : true,
				range:[1,99]
			}
		},
		messages : {
			'name' : {
				required : "请输入分类名称 "
			},
			'orderby' : {
				required : "请填写排序值",
				range:"请输入1~99的整数"
			}
		}
	});
});
</script>
</head>
<body>
<include file="Public:header" />
<div class="home-index">
	<div class="container">
    <div class="row">
      <ol class="breadcrumb">
        <li>首页</li>
        <li><a class='' href="__URL__/index">资讯分类</a></li>
        <li class="active">添加分类</li>
      </ol>
	<div class="comm-box">
		<form id="artcateform" role="form" method="post" action="__URL__/create" >
		
		<div class="form-group"><label>名称</label> <input type="text"
			name="name" class="form-control" placeholder="请输入名称"></div>
		
		<div class="form-group"><label>排序（1-99,值越小越靠前）</label> <input type="text"
			name="orderby" class="form-control" value="99" placeholder="默认99"></div>
		<button type="submit" class="btn btn-primary">提交</button>
		</form>

	</div>
	</div>
	</div>
</div>
</body>
</html>